﻿using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ChoWorkflowDashboard
{
    /// <summary>
    /// Interaction logic for ChoMultilineInputWindow.xaml
    /// </summary>
    public partial class ChoInputWindow : MetroWindow
    {
        private string _inputText;

        public ChoInputWindow(string text, string title = null, CharacterCasing characterCasing = CharacterCasing.Normal)
        {
            InitializeComponent();

            if (!title.IsNullOrWhiteSpace())
                this.Title = title;

            lblInput.Content = title + ":";
            txtInput.Text = _inputText = text;
            txtInput.CharacterCasing = characterCasing;
        }

        public string InputText
        {
            get { return _inputText; }
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            _inputText = txtInput.Text;
            this.DialogResult = true;
            //this.Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
